import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { BusinessQuery, BusinessVO } from "@/api/budget/business/types";

/**
 * 查询业务部门科目设置列表
 * @param query
 */

export const listBusiness = (query?: BusinessQuery) => {
  return request({
    url: "/budget/business/listPage",
    method: "post",
    data: query
  });
};

export const verifyCount = (contrastDate: string): AxiosPromise<boolean> => {
  return request({
    url: "/budget/business/verifyCount/" + contrastDate,
    method: "get"
  });
};

/**
 * 生成业务部门科目设置
 * @param contrastDate
 */
export const addBusiness = (contrastDate: string) => {
  return request({
    url: "/budget/business/addBusiness?contrastDate=" + contrastDate,
    method: "get"
  });
};

/**
 * 删除业务部门科目设置
 * @param id
 */
export const delBusiness = (id: string | number | Array<string | number>) => {
  return request({
    url: "/budget/business/" + id,
    method: "delete"
  });
};
